/*
 * $Id$
 */
package corejs.expr;

import corejs.rt.Value;
import corejs.rt.TypeError;

/**
 *
 * @author myang
 */
public class AssignmentExpr extends BinaryOperatorExpr {
   
   public AssignmentExpr(final Expression left, final Expression right) {
      super(left, right);
   }

   @Override
   public Value accept(final ExpressionVisitor visitor) {
      if (_left instanceof Assignable) {
         final Assignable l = (Assignable)_left;
         return l.acceptAssignment(visitor, _right);
      }
      throw new TypeError("not assigable");
   }
}
